//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package objects;

import java.util.Collection;
import java.util.LinkedHashMap;

public class Mine {
    private static final LinkedHashMap<Integer, MineGoodEntry> productById = new LinkedHashMap();
    private static final LinkedHashMap<String, MineToolEntry> tools = new LinkedHashMap();
    private static final LinkedHashMap<String, MineGoodEntry> productByName = new LinkedHashMap();
    private static Integer ExpToBuild;

    public Mine() {
    }

    public static void addTool(MineToolEntry tool) {
        tools.put(tool.getTool(), tool);
    }

    public static void addGood(MineGoodEntry good) {
        if(good.getName() != null) {
            good.setInstance(productById.size());
            productById.put(good.getGlobalID(), good);
            productByName.put(good.getName(), good);
        }

    }

    public static MineToolEntry getTool(String name) {
        return (MineToolEntry)tools.get(name);
    }

    public static MineGoodEntry getGoodByName(String name) {
        return (MineGoodEntry)productByName.get(name);
    }

    public static MineGoodEntry getGoodById(Integer id) {
        return (MineGoodEntry)productById.get(id);
    }

    public static Collection<MineGoodEntry> getGoods() {
        return productById.values();
    }

    public static Integer getExpToBuild() {
        return ExpToBuild;
    }

    public static void setExpToBuild(Integer val) {
        ExpToBuild = val;
    }
}
